#ifndef TRACKDATAPARSER_H
#define TRACKDATAPARSER_H
#include <vector>
#include <stdlib.h>
#include "common_struct/common_struct.h"
const float  data_precision = 0.1f;

#pragma pack(push)
#pragma pack(1)
struct MagicNumberInfo
{
    int Identifer;

    short FrameLength;
    short FrameType;

    short FrameSeq;
    unsigned char UDP_cnt;
    unsigned char UDP_Seq;

    short Sector_Seq;
    short Point_cnt;
    int version;
    int reserve[5];
};

struct Point_In
{
    short Point_Seq;
    int Range;
    short Doppler;
    unsigned short Amplitude;
    short Azimuth;
    short SNR;
    short Height;
    short PitchAngle;
    short Noise;
};

typedef struct Track_Out
{
    int Track_ID;
    int Track_Range;                  //距离x（滤波值）
    int Track_Azimuth;                //方位（滤波值）
    short Track_Height;               //高度z（滤波值）
    int Track_Velocity;               //速度 m/s  0.1

    int point_type;                   //补点：0 实点：1
    int unupdated_cnt;
    int updated_cnt;

    int track_deletion_threshold;
    int track_type;                   //暂定：0 稳定：1
    short SNR;
}Track_Out;
typedef struct Track_Out_CR
{
    int Track_ID;
    int Track_Range;                  //距离
    int Track_Azimuth;                //方位
    int Track_Height;                 //高度
    int pitchAngle;					//俯仰
    int Track_Velocity;
    int point_type;
    short time_tolive;
}Track_Out_CR;
#pragma pack(pop)

enum frame_type
{
    enum_track_data = 0x0101,
    enum_point_data = 0x0103,
};
class TrackDataParser
{
public:
    TrackDataParser();
    parseTrackData_FromUDP(unsigned char* buffer, int buffer_size, TargetMessageStruct* track_buffer, int track_size);
    parserPointData_FromUDP(unsigned char* buffer, int buffer_size, TargetMessageStruct* track_buffer, int track_size);

};

#endif // TRACKDATAPARSER_H
